package lianxi;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.commons.dbcp2.BasicDataSource;

import com.BasicDataSourceUtil;

public class _02_ {
	public static void main(String[] args) throws SQLException {
		BasicDataSource bds = BasicDataSourceUtil.getInstance().getBasicDataSource();
		// 获取连接
		String sql = "UPDATE student_score set score = 90 where stdno = '001' and coursename = '高等数学'";
		Connection connection = bds.getConnection();
		PreparedStatement preparedStatement = connection.prepareStatement(sql);
		int resultSet = preparedStatement.executeUpdate(sql);

		System.out.println("影响了 " + resultSet + " 行数据");
	}
}
